<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<infopost-request>
			<xsl:for-each select="InsuReq">
				<request-head>
					<xsl:choose>
						<xsl:when test="Main[1]/TranCode= 1001">
							<trans-id>
								<xsl:value-of select="Main[1]/TransNo"/>
							</trans-id>
						</xsl:when>
						<xsl:otherwise>
							<trans-id>
								<xsl:value-of select="Main[1]/TransNo"/>
							</trans-id>
						</xsl:otherwise>
					</xsl:choose>
					<xsl:call-template name="TransTypeCode">
						<xsl:with-param name="srcCode" select="Main[1]/TranCode"/>
					</xsl:call-template>
					<xsl:call-template name="sourceTypeCode">
						<xsl:with-param name="srcCode" select="Main[1]/Channel"/>
					</xsl:call-template>
					<insu-id>
						<xsl:value-of select="Main[1]/InsuId"/>
					</insu-id>
					<trans-date>
						<xsl:value-of select="Main[1]/TranDate"/>
					</trans-date>
					<trans-time>
						<xsl:value-of select="Main[1]/TranTime"/>
					</trans-time>
					<area>
						<xsl:value-of select="Main[1]/ZoneNo"/>
					</area>
					<bank>209</bank>
					<branch/>
					<post>
						<xsl:value-of select="Main[1]/BrNo"/>
					</post>
					<agency-hand>
						<xsl:value-of select="Main[1]/TellerNo"/>
					</agency-hand>
					<authorized/>
					<column1>
						<xsl:value-of select="Main[1]/BrName"/>
					</column1>
					<column2>
						<xsl:value-of select="Main[1]/BrCertID"/>
					</column2>
					<column3>
						<xsl:value-of select="Main[1]/ManagerNo"/>
					</column3>
					<column4>
						<xsl:value-of select="Main[1]/ManagerName"/>
					</column4>
					<column5>
						<xsl:value-of select="Main[1]/RiskAssess"/>
					</column5>
				</request-head>
				<xsl:choose>
					<!--01 保费试算 -->
					<xsl:when test="Main[1]/TranCode=1001">
						<request-newbiz>
							<request-underwriting>
								<application>
									<apply-code>
										<xsl:value-of select="Main[1]/ApplyNo"/>
									</apply-code>
									<apply-date>
										<xsl:value-of select="Main[1]/ApplyDate"/>
									</apply-date>
									<validate-date/>
									<sell-way>3</sell-way>
									<policy-type>3</policy-type>
									<group-single>2</group-single>
									<branch-bank/>
									<agency-code>
										<xsl:value-of select="Main[1]/BrNo"/>
									</agency-code>
									<agency-hand>
										<xsl:value-of select="Main[1]/TellerNo"/>
									</agency-hand>
									<agent-code/>
									<agent-name/>
									<bank-code>209</bank-code>
									<account-type>7</account-type>
									<account-name>
										<xsl:value-of select="Risks[1]/Appendix/PayAccName"/>
									</account-name>
									<bank-account>
										<xsl:value-of select="Risks[1]/Appendix/PayAcc"/>
									</bank-account>
									<pay-mode>
										<xsl:call-template name="PayModeCode">
											<xsl:with-param name="srcCode" select="Risks[1]/Appendix/PayMethod"/>
										</xsl:call-template>
									</pay-mode>
									<pay-next>
										<xsl:call-template name="PayModeCode">
											<xsl:with-param name="srcCode" select="Risks[1]/Appendix/PayMethod"/>
										</xsl:call-template>
									</pay-next>
									<overdue-manage>1</overdue-manage>
									<over-manage>2</over-manage>
									<deliver-type>4</deliver-type>
									<currency-code>1</currency-code>
									<assumpsit/>
									<answer-type>1</answer-type>
									<answer-phone/>
									<answer-assumpsit/>
									<premium/>
									<!-- 健康告知 -->
									<xsl:call-template name="HealthNotice">
										<xsl:with-param name="srcCode" select="Risks[1]/Appendix/HealthFlag"/>
									</xsl:call-template>
									<policy-pwd/>
									<print-code/>
									<column1>
										<xsl:value-of select="Main[1]/SellTeller"/>
									</column1>
									<column2>
										<xsl:value-of select="Main[1]/SellTellerName"/>
									</column2>
									<column3>
										<xsl:value-of select="Main[1]/SellCertID"/>
									</column3>
									<column4>
										<xsl:value-of select="Main[1]/CertIDValidDate"/>
									</column4>
									<column5>
										<xsl:value-of select="InsuReq/Remark5"/>
									</column5>
									<acc-bankname/>
									<bank-accno/>
									<xsl:for-each select="Appnt">
										<policy-holder>
											<real-name>
												<xsl:value-of select="Name"/>
											</real-name>
											<xsl:call-template name="GenderCode">
												<xsl:with-param name="srcCode" select="Sex"/>
											</xsl:call-template>
											<birthday>
												<xsl:value-of select="Birthday"/>
											</birthday>
											<marriage-id/>
											<xsl:choose>
												<xsl:when test="County = ''">
													<xsl:call-template name="CertiTypeCodeMapToCountry">
														<xsl:with-param name="srcCode" select="IDType"/>
													</xsl:call-template>
												</xsl:when>
												<xsl:otherwise>
													<nationality>
														<xsl:value-of select="County"/>
													</nationality>
												</xsl:otherwise>
											</xsl:choose>
											<race/>
											<homeplace/>
											<seat-address/>
											<xsl:call-template name="CertiTypeCode">
												<xsl:with-param name="srcCode" select="IDType"/>
											</xsl:call-template>
											<certi-code>
												<xsl:value-of select="IDNo"/>
											</certi-code>
											<certi-start-date>
												<xsl:value-of select="IDStartDate"/>
											</certi-start-date>
											<certi-end-date>
												<xsl:value-of select="IDEndDate"/>
											</certi-end-date>
											<rela-address>
												<xsl:value-of select="HomeAddr"/>
											</rela-address>
											<rela-zip>
												<xsl:value-of select="HomeZipCode"/>
											</rela-zip>
											<!--<day-phone>
                                                <xsl:value-of select="OfficePhone"/>
                                            </day-phone>
                                            <night-phone>
                                                <xsl:value-of select="HomePhone"/>
                                            </night-phone>-->
											<!--应客户信息校验三期需求要求，家庭电话存入核心固定电话1，取消办公电话的校验-->
											<day-phone>
												<xsl:value-of select="HomePhone"/>
											</day-phone>
											<night-phone/>
											<celler>
												<xsl:value-of select="MobilePhone"/>
											</celler>
											<email>
												<xsl:value-of select="Email"/>
											</email>
											<pay-address>
												<xsl:value-of select="HomeAddr"/>
											</pay-address>
											<pay-zip>
												<xsl:value-of select="HomeZipCode"/>
											</pay-zip>
											<job-com/>
											<job-address/>
											<job-zip/>
											<industy/>
											<title/>
											<job-name/>
											<pt-job-name/>
											<!-- 职业代码 -->
											<xsl:call-template name="jobCodeCode">
												<xsl:with-param name="srcCode" select="JobCode"/>
											</xsl:call-template>
											<relation-with-main-insured>
												<xsl:call-template name="TLaPhRela">
													<xsl:with-param name="CodeValue" select="RelaToInsured"/>
												</xsl:call-template>
											</relation-with-main-insured>
											<smoking>N</smoking>
											<yearly-income>
												<xsl:value-of select="Income"/>
											</yearly-income>
											<social-security/>
											<height/>
											<weight/>
											<valid-year/>
											<column1>
												<xsl:value-of select="/InsuReq/Main[1]/ResiType"/>
											</column1>
											<column2>
												<xsl:value-of select="/InsuReq/Main[1]/FamilyIncome"/>
											</column2>
											<column3>
												<xsl:value-of select="/InsuReq/Main[1]/PremBudget"/>
											</column3>
										</policy-holder>
									</xsl:for-each>
									<life-assureds>
										<xsl:for-each select="Insured">
											<life-assured>
												<xsl:choose>
													<xsl:when test="/InsuReq/Appnt[1]/RelaToInsured= 01 and position()=1">
														<la-no>1</la-no>
														<xsl:choose>
															<xsl:when test="Name = '' ">
																<real-name>
																	<xsl:value-of select="/InsuReq/Appnt[1]/Name"/>
																</real-name>
															</xsl:when>
															<xsl:otherwise>
																<real-name>
																	<xsl:value-of select="Name"/>
																</real-name>
															</xsl:otherwise>
														</xsl:choose>
														<xsl:choose>
															<xsl:when test="Sex = '' ">
																<xsl:call-template name="GenderCode">
																	<xsl:with-param name="srcCode" select="/InsuReq/Appnt[1]/Sex"/>
																</xsl:call-template>
															</xsl:when>
															<xsl:otherwise>
																<xsl:call-template name="GenderCode">
																	<xsl:with-param name="srcCode" select="Sex"/>
																</xsl:call-template>
															</xsl:otherwise>
														</xsl:choose>
														<xsl:choose>
															<xsl:when test="Birthday = '' ">
																<birthday>
																	<xsl:value-of select="/InsuReq/Appnt[1]/Birthday"/>
																</birthday>
															</xsl:when>
															<xsl:otherwise>
																<birthday>
																	<xsl:value-of select="Birthday"/>
																</birthday>
															</xsl:otherwise>
														</xsl:choose>
														<marriage-id/>
														<xsl:choose>
															<xsl:when test="/InsuReq/Appnt[1]/County = ''">
																<xsl:call-template name="CertiTypeCodeMapToCountry">
																	<xsl:with-param name="srcCode" select="/InsuReq/Appnt[1]/IDType"/>
																</xsl:call-template>
															</xsl:when>
															<xsl:otherwise>
																<nationality>
																	<xsl:value-of select="/InsuReq/Appnt[1]/County"/>
																</nationality>
															</xsl:otherwise>
														</xsl:choose>
														<race/>
														<homeplace/>
														<seat-address/>
														<xsl:choose>
															<xsl:when test="IDType = '' ">
																<xsl:call-template name="CertiTypeCode">
																	<xsl:with-param name="srcCode" select="/InsuReq/Appnt[1]/IDType"/>
																</xsl:call-template>
															</xsl:when>
															<xsl:otherwise>
																<xsl:call-template name="CertiTypeCode">
																	<xsl:with-param name="srcCode" select="/InsuReq/Appnt[1]/IDType"/>
																</xsl:call-template>
															</xsl:otherwise>
														</xsl:choose>
														<xsl:choose>
															<xsl:when test="IDNo = '' ">
																<certi-code>
																	<xsl:value-of select="/InsuReq/Appnt[1]/IDNo"/>
																</certi-code>
															</xsl:when>
															<xsl:otherwise>
																<certi-code>
																	<xsl:value-of select="IDNo"/>
																</certi-code>
															</xsl:otherwise>
														</xsl:choose>
														<certi-start-date>
															<xsl:value-of select="IDStartDate"/>
														</certi-start-date>
														<certi-end-date>
															<xsl:value-of select="IDEndDate"/>
														</certi-end-date>
														<rela-address>
															<xsl:value-of select="/InsuReq/Appnt[1]/HomeAddr"/>
														</rela-address>
														<rela-zip>
															<xsl:value-of select="/InsuReq/Appnt[1]/HomeZipCode"/>
														</rela-zip>
														<!--<night-phone>
                                                            <xsl:value-of select="/InsuReq/Appnt[1]/HomePhone"/>
                                                        </night-phone>
                                                        <day-phone>
                                                            <xsl:value-of select="/InsuReq/Appnt[1]/OfficePhone"/>
                                                        </day-phone>-->
														<!--应客户信息校验三期需求要求，家庭电话存入核心固定电话1，取消办公电话的校验-->
														<night-phone/>
														<day-phone>
															<xsl:value-of select="/InsuReq/Appnt[1]/HomePhone"/>
														</day-phone>
														<celler>
															<xsl:value-of select="/InsuReq/Appnt[1]/MobilePhone"/>
														</celler>
														<email>
															<xsl:value-of select="/InsuReq/Appnt[1]/Email"/>
														</email>
														<job-com/>
														<job-address/>
														<job-zip/>
														<industy/>
														<title/>
														<job-name/>
														<pt-job-name/>
														<!-- 职业代码 -->
														<xsl:call-template name="jobCodeCode">
															<xsl:with-param name="srcCode" select="/InsuReq/Appnt[1]/JobCode"/>
														</xsl:call-template>
														<relation-with-policy-holder>1</relation-with-policy-holder>
														<relation-with-main-insured>1</relation-with-main-insured>
														<smoking>N</smoking>
														<yearly-income/>
														<social-security/>
														<height/>
														<weight/>
														<valid-year/>
													</xsl:when>
													<xsl:otherwise>
														<la-no>
															<xsl:number value="position()"/>
														</la-no>
														<real-name>
															<xsl:value-of select="Name"/>
														</real-name>
														<xsl:call-template name="GenderCode">
															<xsl:with-param name="srcCode" select="Sex"/>
														</xsl:call-template>
														<birthday>
															<xsl:value-of select="Birthday"/>
														</birthday>
														<marriage-id/>
														<xsl:choose>
															<xsl:when test="County = ''">
																<xsl:call-template name="CertiTypeCodeMapToCountry">
																	<xsl:with-param name="srcCode" select="IDType"/>
																</xsl:call-template>
															</xsl:when>
															<xsl:otherwise>
																<nationality>
																	<xsl:value-of select="County"/>
																</nationality>
															</xsl:otherwise>
														</xsl:choose>
														<race/>
														<homeplace/>
														<seat-address/>
														<xsl:call-template name="CertiTypeCode">
															<xsl:with-param name="srcCode" select="IDType"/>
														</xsl:call-template>
														<certi-code>
															<xsl:value-of select="IDNo"/>
														</certi-code>
														<certi-start-date>
															<xsl:value-of select="IDStartDate"/>
														</certi-start-date>
														<certi-end-date>
															<xsl:value-of select="IDEndDate"/>
														</certi-end-date>
														<rela-address>
															<xsl:value-of select="HomeAddr"/>
														</rela-address>
														<rela-zip>
															<xsl:value-of select="HomeZipCode"/>
														</rela-zip>
														<!--<night-phone>
                                                            <xsl:value-of select="HomePhone"/>
                                                        </night-phone>
                                                        <day-phone>
                                                            <xsl:value-of select="OfficePhone"/>
                                                        </day-phone>-->
														<!--应客户信息校验三期需求要求，家庭电话存入核心固定电话1，取消办公电话的校验-->
														<night-phone/>
														<day-phone>
															<xsl:value-of select="HomePhone"/>
														</day-phone>
														<celler>
															<xsl:value-of select="MobilePhone"/>
														</celler>
														<email>
															<xsl:value-of select="Email"/>
														</email>
														<job-com/>
														<job-address/>
														<job-zip/>
														<industy/>
														<title/>
														<job-name/>
														<pt-job-name/>
														<!-- 职业代码 -->
														<xsl:call-template name="jobCodeCode">
															<xsl:with-param name="srcCode" select="JobCode"/>
														</xsl:call-template>
														<relation-with-policy-holder>
															<xsl:call-template name="TPhLaRela">
																<xsl:with-param name="CodeValue" select="/InsuReq/Appnt  [1]/RelaToInsured"/>
															</xsl:call-template>
														</relation-with-policy-holder>
														<relation-with-main-insured>1</relation-with-main-insured>
														<smoking>N</smoking>
														<yearly-income/>
														<social-security/>
														<height/>
														<weight/>
														<valid-year/>
													</xsl:otherwise>
												</xsl:choose>
											</life-assured>
										</xsl:for-each>
									</life-assureds>
									<xsl:for-each select="Bnfs">
										<beneficiaries>
											<xsl:choose>
												<xsl:when test="Count = 0"/>
												<xsl:otherwise>
													<xsl:for-each select="Bnf">
														<beneficiary>
															<la-no>1</la-no>
															<xsl:choose>
																<xsl:when test="RelationToInsured= 01">
																	<legal-bene-indi>Y</legal-bene-indi>
																</xsl:when>
																<xsl:otherwise>
																	<legal-bene-indi>N</legal-bene-indi>
																</xsl:otherwise>
															</xsl:choose>
															<real-name>
																<xsl:value-of select="Name"/>
															</real-name>
															<xsl:call-template name="GenderCode">
																<xsl:with-param name="srcCode" select="Sex"/>
															</xsl:call-template>
															<birthday>
																<xsl:value-of select="Birthday"/>
															</birthday>
															<xsl:call-template name="CertiTypeCode">
																<xsl:with-param name="srcCode" select="IDType"/>
															</xsl:call-template>
															<certi-code>
																<xsl:value-of select="IDNo"/>
															</certi-code>
															<certi-start-date/>
															<certi-end-date/>
															<xsl:choose>
																<xsl:when test="County = ''">
																	<xsl:call-template name="CertiTypeCodeMapToCountry">
																		<xsl:with-param name="srcCode" select="IDType"/>
																	</xsl:call-template>
																</xsl:when>
																<xsl:otherwise>
																	<nationality>
																		<xsl:value-of select="County"/>
																	</nationality>
																</xsl:otherwise>
															</xsl:choose>
															<xsl:call-template name="BeneTypeCode">
																<xsl:with-param name="srcCode" select="Type"/>
															</xsl:call-template>
															<bene-order>
																<xsl:value-of select="Order"/>
															</bene-order>
															<bene-rate>
																<xsl:value-of select="Percent"/>
															</bene-rate>
															<address>
																<xsl:value-of select="HomeAddr"/>
															</address>
															<zip/>
															<job-code/>
															<relation-with-insured>
																<xsl:call-template name="TBeneDesignation">
																	<xsl:with-param name="CodeValue" select="RelationToInsured"/>
																</xsl:call-template>
															</relation-with-insured>
															<!---     bene-is-empty  is added as check condition       -->
															<xsl:choose>
																<xsl:when test="Name='' and Sex='' and RelationToInsured='' and  IDType='' and IDNo='' and Birthday='' and BnfGrade='' and BnfLot=''">
																	<bene-is-empty>Y</bene-is-empty>
																</xsl:when>
																<xsl:otherwise>
																	<bene-is-empty>N</bene-is-empty>
																</xsl:otherwise>
															</xsl:choose>
														</beneficiary>
													</xsl:for-each>
												</xsl:otherwise>
											</xsl:choose>
										</beneficiaries>
									</xsl:for-each>
									<xsl:for-each select="Risks">
										<products>
											<xsl:for-each select="Risk">
												<product>
													<la-no>1</la-no>
													<product-num>100</product-num>
													<external-prd-code>
														<xsl:value-of select="Code"/>
													</external-prd-code>
													<product-name/>
													<is-waiver>N</is-waiver>
													<waiver-num/>
													<waiver-object/>
													<xsl:choose>
														<xsl:when test="../Appendix/PayIntV = 1">
															<charge-period>1</charge-period>
														</xsl:when>
														<xsl:otherwise>
															<xsl:call-template name="ChargePeriodCode">
																<xsl:with-param name="srcCode" select="PayEndYearFlag"/>
															</xsl:call-template>
														</xsl:otherwise>
													</xsl:choose>
													<charge-year>
														<xsl:value-of select="PayEndYear"/>
													</charge-year>
													<xsl:call-template name="CoveragePeriodCode">
														<xsl:with-param name="srcCode" select="InsuYearFlag"/>
													</xsl:call-template>
													<coverage-year>
														<xsl:value-of select="InsuYear"/>
													</coverage-year>
													<xsl:call-template name="ChargeModeCode">
														<xsl:with-param name="srcCode" select="/InsuReq/Risks[1]/Appendix/PayIntv"/>
													</xsl:call-template>
													<pay-period/>
													<pay-year/>
													<end-period/>
													<end-year/>
													<pay-ensure/>
													<pay-type/>
													<amount>
														<xsl:value-of select="InsuAmount"/>
													</amount>
													<unit>
														<xsl:value-of select="Unit"/>
													</unit>
													<discount-prem>
														<xsl:if test=" Premium!= ''  ">
															<xsl:value-of select="Premium"/>
														</xsl:if>
													</discount-prem>
													<count-way/>
													<bonus-choice>1</bonus-choice>
													<xsl:choose>
														<xsl:when test="InsuAmount= ''">
															<column1>Y</column1>
														</xsl:when>
														<xsl:otherwise>
															<column1>N</column1>
														</xsl:otherwise>
													</xsl:choose>
													<column2/>
													<column3/>
													<column4/>
													<column5/>
													<main-riskcode>
														<xsl:value-of select="MainSubFlag"/>
													</main-riskcode>
													<password/>
													<rate>
														<xsl:value-of select="Rate"/>
													</rate>
													<cvali-date>
														<xsl:value-of select="CValiDate"/>
													</cvali-date>
													<autopay-flag>
														<xsl:value-of select="AutoPayFlag"/>
													</autopay-flag>
													<bonuspay-mode>
														<xsl:value-of select="Appendix/BonusGetMode"/>
													</bonuspay-mode>
													<sub-flag>
														<xsl:value-of select="Appendix/SubFlag"/>
													</sub-flag>
													<Iscash-autopay/>
													<Iscash-joininvest/>
													<health-flag>
														<xsl:value-of select="Appendix/HealthFlag"/>
													</health-flag>
													<fullbonus-getmode>
														<xsl:value-of select="Appendix/BonusGetMode"/>
													</fullbonus-getmode>
													<first-rate>
														<xsl:value-of select="Appendix/FirstRate"/>
													</first-rate>
													<sure-rate>
														<xsl:value-of select="Appendix/SureRate"/>
													</sure-rate>
													<end-date/>
													<pay-date/>
												</product>
											</xsl:for-each>
										</products>
									</xsl:for-each>
								</application>
							</request-underwriting>
						</request-newbiz>
					</xsl:when>
				</xsl:choose>
			</xsl:for-each>
		</infopost-request>
	</xsl:template>
	<xsl:template name="sourceTypeCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = '4'">
				<source-type>8</source-type>
			</xsl:when>
			<xsl:otherwise>
				<source-type>0</source-type>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="jobCodeCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = ''">
				<job-code>006901</job-code>
			</xsl:when>
			<xsl:otherwise>
				<job-code>
					<xsl:value-of select="$srcCode"/>
				</job-code>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="HealthNotice">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = 'Y'">
				<health-notice>Y</health-notice>
			</xsl:when>
			<xsl:otherwise>
				<health-notice>N</health-notice>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="PayModeCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = '1'">3</xsl:when>
			<xsl:when test="$srcCode = '2'">80</xsl:when>
			<xsl:when test="$srcCode = ''">3</xsl:when>
			<xsl:otherwise>CODE_NOT_EXIST</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="ChargeModeCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = '06'">
				<charge-mode>6</charge-mode>
			</xsl:when>
			<xsl:when test="$srcCode = '01'">
				<charge-mode>5</charge-mode>
			</xsl:when>
			<xsl:when test="$srcCode = '05'">
				<charge-mode>4</charge-mode>
			</xsl:when>
			<xsl:when test="$srcCode = '04'">
				<charge-mode>3</charge-mode>
			</xsl:when>
			<xsl:when test="$srcCode = '03'">
				<charge-mode>2</charge-mode>
			</xsl:when>
			<xsl:when test="$srcCode = '02'">
				<charge-mode>1</charge-mode>
			</xsl:when>
			<xsl:otherwise>
				<charge-mode>CODE_NOT_EXIST</charge-mode>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="BeneTypeCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = 0">
				<bene-type>1</bene-type>
			</xsl:when>
			<xsl:when test="$srcCode = 1">
				<bene-type>2</bene-type>
			</xsl:when>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="TransTypeCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = 1001">
				<trans-type>104</trans-type>
			</xsl:when>
			<xsl:when test="$srcCode = 1002">
				<trans-type>102</trans-type>
			</xsl:when>
			<xsl:when test="$srcCode = 1003">
				<trans-type>103</trans-type>
			</xsl:when>
			<xsl:when test="$srcCode = 1004">
				<trans-type>201</trans-type>
			</xsl:when>
			<xsl:when test="$srcCode = 1005">
				<trans-type>106</trans-type>
			</xsl:when>
			<xsl:when test="$srcCode = 0">
				<trans-type>0</trans-type>
			</xsl:when>
			<xsl:otherwise>
				<trans-type>000000</trans-type>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="GenderCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = 1">
				<gender>M</gender>
			</xsl:when>
			<xsl:when test="$srcCode = 0">
				<gender>F</gender>
			</xsl:when>
			<xsl:when test="$srcCode = 2">
				<gender>N</gender>
			</xsl:when>
			<xsl:when test="$srcCode = ''">
				<gender/>
			</xsl:when>
			<xsl:otherwise>
				<gender>CODE_NOT_EXIST</gender>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="CertiTypeCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = '01' or  $srcCode='02'">
				<certi-type>1</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode ='05' ">
				<certi-type>2</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode ='03' ">
				<certi-type>3</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode ='04'">
				<certi-type>7</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode='47' or $srcCode='48'">
				<certi-type>6</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode='08' or $srcCode='09' or $srcCode='10' or $srcCode='11' or $srcCode='49'">
				<certi-type>9</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = '06' ">
				<certi-type>8</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = ''">
				<certi-type/>
			</xsl:when>
			<xsl:otherwise>
				<certi-type>CODE_NOT_EXIST</certi-type>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="CertiTypeCodeMapToCountry">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode ='CN'">
				<nationality>156</nationality>
			</xsl:when>
			<xsl:when test="$srcCode ='HK'">
				<nationality>344</nationality>
			</xsl:when>
			<xsl:otherwise/>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="PhCertiTypeCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = '01' or  $srcCode='02'">
				<certi-type>1</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode ='05' ">
				<certi-type>2</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode ='03' ">
				<certi-type>3</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode ='04'">
				<certi-type>7</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode='08' or $srcCode='09' or $srcCode='10' or $srcCode='11' or $srcCode='47' or $srcCode='48' or $srcCode='49'">
				<certi-type>9</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = '06' ">
				<certi-type>8</certi-type>
			</xsl:when>
			<xsl:when test="$srcCode = ''">
				<certi-type/>
			</xsl:when>
			<xsl:otherwise>
				<certi-type>CODE_NOT_EXIST</certi-type>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="ChargePeriodCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = '07'">
				<charge-period>3</charge-period>
			</xsl:when>
			<xsl:when test="$srcCode = '02'">
				<charge-period>2</charge-period>
			</xsl:when>
			<xsl:when test="$srcCode = '01'">
				<charge-period>1</charge-period>
			</xsl:when>
			<xsl:when test="$srcCode = ''">
				<charge-period/>
			</xsl:when>
			<xsl:otherwise>
				<charge-period>CODE_NOT_EXIST</charge-period>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="CoveragePeriodCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = '06'">
				<coverage-period>1</coverage-period>
			</xsl:when>
			<xsl:when test="$srcCode = '01'">
				<coverage-period>2</coverage-period>
			</xsl:when>
			<xsl:when test="$srcCode = '05'">
				<coverage-period>3</coverage-period>
			</xsl:when>
			<xsl:when test="$srcCode = '03'">
				<coverage-period>4</coverage-period>
			</xsl:when>
			<xsl:when test="$srcCode = '04'">
				<coverage-period>5</coverage-period>
			</xsl:when>
			<xsl:otherwise>
				<coverage-period>CODE_NOT_EXIST</coverage-period>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="NationMapByCertyType">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode ='CN'">
				<nationality>156</nationality>
			</xsl:when>
			<xsl:when test="$srcCode ='HK'">
				<nationality>344</nationality>
			</xsl:when>
			<xsl:otherwise/>
		</xsl:choose>
	</xsl:template>
	<!--投保人与被保人关系-->
	<xsl:template name="TLaPhRela">
		<xsl:param name="CodeValue"/>
		<xsl:choose>
			<!--本人-->
			<xsl:when test="$CodeValue='01'">1</xsl:when>
			<!--丈夫-->
			<xsl:when test="$CodeValue='02'">3</xsl:when>
			<!--妻子-->
			<xsl:when test="$CodeValue='03'">3</xsl:when>
			<!--父亲-->
			<xsl:when test="$CodeValue='04'">10</xsl:when>
			<!--母亲-->
			<xsl:when test="$CodeValue='05'">10</xsl:when>
			<!--儿子-->
			<xsl:when test="$CodeValue='06'">2</xsl:when>
			<!--女儿-->
			<xsl:when test="$CodeValue='07'">2</xsl:when>
			<!--祖父-->
			<xsl:when test="$CodeValue='08'">12</xsl:when>
			<!--祖母-->
			<xsl:when test="$CodeValue='09'">12</xsl:when>
			<!--孙子-->
			<xsl:when test="$CodeValue='10'">13</xsl:when>
			<!--孙女-->
			<xsl:when test="$CodeValue='11'">13</xsl:when>
			<!--外祖父-->
			<xsl:when test="$CodeValue='12'">12</xsl:when>
			<!--外祖母-->
			<xsl:when test="$CodeValue='13'">12</xsl:when>
			<!--外孙-->
			<xsl:when test="$CodeValue='14'">13</xsl:when>
			<!--外孙女-->
			<xsl:when test="$CodeValue='15'">13</xsl:when>
			<!--哥哥-->
			<xsl:when test="$CodeValue='16'">11</xsl:when>
			<!--姐姐-->
			<xsl:when test="$CodeValue='17'">11</xsl:when>
			<!--弟弟-->
			<xsl:when test="$CodeValue='18'">11</xsl:when>
			<!--妹妹-->
			<xsl:when test="$CodeValue='19'">11</xsl:when>
			<!--公公-->
			<xsl:when test="$CodeValue='20'">14</xsl:when>
			<!--婆婆-->
			<xsl:when test="$CodeValue='21'">14</xsl:when>
			<!--儿媳-->
			<xsl:when test="$CodeValue='22'">14</xsl:when>
			<!--岳父-->
			<xsl:when test="$CodeValue='23'">14</xsl:when>
			<!--岳母-->
			<xsl:when test="$CodeValue='24'">14</xsl:when>
			<!--女婿-->
			<xsl:when test="$CodeValue='25'">14</xsl:when>
			<!--其它亲属-->
			<xsl:when test="$CodeValue='26'">14</xsl:when>
			<!--同事-->
			<xsl:when test="$CodeValue='27'">7</xsl:when>
			<!--朋友-->
			<xsl:when test="$CodeValue='28'">7</xsl:when>
			<!--雇主-->
			<xsl:when test="$CodeValue='29'">18</xsl:when>
			<!--其它-->
			<xsl:when test="$CodeValue='99'">7</xsl:when>
			<xsl:otherwise>7</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<!--被保人与投保人关系-->
	<xsl:template name="TPhLaRela">
		<xsl:param name="CodeValue"/>
		<xsl:choose>
			<!--本人-->
			<xsl:when test="$CodeValue='01'">1</xsl:when>
			<!--丈夫-->
			<xsl:when test="$CodeValue='02'">3</xsl:when>
			<!--妻子-->
			<xsl:when test="$CodeValue='03'">3</xsl:when>
			<!--父亲-->
			<xsl:when test="$CodeValue='04'">2</xsl:when>
			<!--母亲-->
			<xsl:when test="$CodeValue='05'">2</xsl:when>
			<!--儿子-->
			<xsl:when test="$CodeValue='06'">10</xsl:when>
			<!--女儿-->
			<xsl:when test="$CodeValue='07'">10</xsl:when>
			<!--祖父-->
			<xsl:when test="$CodeValue='08'">13</xsl:when>
			<!--祖母-->
			<xsl:when test="$CodeValue='09'">13</xsl:when>
			<!--孙子-->
			<xsl:when test="$CodeValue='10'">12</xsl:when>
			<!--孙女-->
			<xsl:when test="$CodeValue='11'">12</xsl:when>
			<!--外祖父-->
			<xsl:when test="$CodeValue='12'">13</xsl:when>
			<!--外祖母-->
			<xsl:when test="$CodeValue='13'">13</xsl:when>
			<!--外孙-->
			<xsl:when test="$CodeValue='14'">12</xsl:when>
			<!--外孙女-->
			<xsl:when test="$CodeValue='15'">12</xsl:when>
			<!--哥哥-->
			<xsl:when test="$CodeValue='16'">11</xsl:when>
			<!--姐姐-->
			<xsl:when test="$CodeValue='17'">11</xsl:when>
			<!--弟弟-->
			<xsl:when test="$CodeValue='18'">11</xsl:when>
			<!--妹妹-->
			<xsl:when test="$CodeValue='19'">11</xsl:when>
			<!--公公-->
			<xsl:when test="$CodeValue='20'">14</xsl:when>
			<!--婆婆-->
			<xsl:when test="$CodeValue='21'">14</xsl:when>
			<!--儿媳-->
			<xsl:when test="$CodeValue='22'">14</xsl:when>
			<!--岳父-->
			<xsl:when test="$CodeValue='23'">14</xsl:when>
			<!--岳母-->
			<xsl:when test="$CodeValue='24'">14</xsl:when>
			<!--女婿-->
			<xsl:when test="$CodeValue='25'">14</xsl:when>
			<!--其它亲属-->
			<xsl:when test="$CodeValue='26'">14</xsl:when>
			<!--同事-->
			<xsl:when test="$CodeValue='27'">7</xsl:when>
			<!--朋友-->
			<xsl:when test="$CodeValue='28'">7</xsl:when>
			<!--雇主-->
			<xsl:when test="$CodeValue='29'">18</xsl:when>
			<!--其它-->
			<xsl:when test="$CodeValue='99'">7</xsl:when>
			<xsl:otherwise>7</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<!--受益人与被保人关系-->
	<xsl:template name="TBeneDesignation">
		<xsl:param name="CodeValue"/>
		<xsl:choose>
			<!--本人-->
			<xsl:when test="$CodeValue='01'">0</xsl:when>
			<!--丈夫-->
			<xsl:when test="$CodeValue='02'">2</xsl:when>
			<!--妻子-->
			<xsl:when test="$CodeValue='03'">1</xsl:when>
			<!--父亲-->
			<xsl:when test="$CodeValue='04'">4</xsl:when>
			<!--母亲-->
			<xsl:when test="$CodeValue='05'">5</xsl:when>
			<!--儿子-->
			<xsl:when test="$CodeValue='06'">3</xsl:when>
			<!--女儿-->
			<xsl:when test="$CodeValue='07'">3</xsl:when>
			<!--祖父-->
			<xsl:when test="$CodeValue='08'">6</xsl:when>
			<!--祖母-->
			<xsl:when test="$CodeValue='09'">7</xsl:when>
			<!--孙子-->
			<xsl:when test="$CodeValue='10'">15</xsl:when>
			<!--孙女-->
			<xsl:when test="$CodeValue='11'">15</xsl:when>
			<!--外祖父-->
			<xsl:when test="$CodeValue='12'">6</xsl:when>
			<!--外祖母-->
			<xsl:when test="$CodeValue='13'">7</xsl:when>
			<!--外孙-->
			<xsl:when test="$CodeValue='14'">15</xsl:when>
			<!--外孙女-->
			<xsl:when test="$CodeValue='15'">15</xsl:when>
			<!--哥哥-->
			<xsl:when test="$CodeValue='16'">8</xsl:when>
			<!--姐姐-->
			<xsl:when test="$CodeValue='17'">9</xsl:when>
			<!--弟弟-->
			<xsl:when test="$CodeValue='18'">8</xsl:when>
			<!--妹妹-->
			<xsl:when test="$CodeValue='19'">9</xsl:when>
			<!--公公-->
			<xsl:when test="$CodeValue='20'">15</xsl:when>
			<!--婆婆-->
			<xsl:when test="$CodeValue='21'">15</xsl:when>
			<!--儿媳-->
			<xsl:when test="$CodeValue='22'">15</xsl:when>
			<!--岳父-->
			<xsl:when test="$CodeValue='23'">15</xsl:when>
			<!--岳母-->
			<xsl:when test="$CodeValue='24'">15</xsl:when>
			<!--女婿-->
			<xsl:when test="$CodeValue='25'">15</xsl:when>
			<!--其它亲属-->
			<xsl:when test="$CodeValue='26'">15</xsl:when>
			<!--同事-->
			<xsl:when test="$CodeValue='27'">15</xsl:when>
			<!--朋友-->
			<xsl:when test="$CodeValue='28'">15</xsl:when>
			<!--雇主-->
			<xsl:when test="$CodeValue='29'">14</xsl:when>
			<!--其它-->
			<xsl:when test="$CodeValue='99'">15</xsl:when>
			<xsl:otherwise>15</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
